package servlets;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import managers.AffichageManager;
import beans.Commande;
import beans.User;

/**
 * Servlet implementation class PanierServlet
 */
public class PanierServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public PanierServlet() {
        super();
        // TODO Auto-generated constructor stub
    }
    
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setAttribute("affichage", AffichageManager
				.buildAffichagePanier((User) request.getSession().getAttribute(
						"user"), (Commande) request.getSession().getAttribute("panier"), false));
		request.getRequestDispatcher("/panier.jsp").forward(request, response);
	}

}
